package xyz.hlh.boot3.service.impl;

import org.apache.dubbo.config.annotation.DubboService;
import xyz.hlh.boot3.pojo.Goods;
import xyz.hlh.boot3.service.GoodsService;

import java.util.ArrayList;
import java.util.List;

/**
 * @author HLH
 * @description: 商品接口实现类
 * @email 17703595860@163.com
 * @date : Created in 2021/10/30 20:55
 */
// 暴露dubbo服务
@DubboService(interfaceClass = GoodsService.class, version = "1.0")
public class GoodsServiceImpl implements GoodsService {

    // 查询接口
    @Override
    public List<Goods> getList() {
        // 模拟数据
        return new ArrayList<Goods>() {
            private static final long serialVersionUID = 7521431029206894406L;
            {
                add(new Goods(1, "小米手机", 5, 5999.0));
                add(new Goods(2, "三星手机", 9, 9999.0));
                add(new Goods(3, "苹果手机", 15, 8999.0));
            }
        };
    }

}
